<template>
	<view>
		<view class="cu-bar search bg-white">
		    <view class="cu-avatar" v-if="titleType!=''" style="background:none;color: #000000;font-size: 0.9rem;width: 70rpx;">按{{titleType}}</view>
		    <view class="search-form round">
		      <text class="cuIcon-search"></text>
		      <input type="text" placeholder="搜索我要的资源" v-model="content" confirm-type="search"></input>
		    </view>
		    <view class="action">
			  <text v-if="content!=''">搜索</text>
		      <text v-else>取消</text>
		    </view>
		  </view>
		  <view class="cu-list menu-avatar solid-bottom">
		  	<view class="cu-item" v-for="(item,index) in 5">
		  		<view class="cu-avatar round lg"
		  			:style="{backgroundImage:'url('+item.headimg+')'}">
		  		</view>
		  		<view class="content flex-sub">
		  			<view><!-- {{item.realname.substring(0,1)}}公子-{{item.realname}} --></view>
		  			<view class="text-gray text-sm flex justify-between">
		  				<!-- {{item.touxian1}} -->
						{{item}}
		  			</view>
		  		</view>
		  	</view>
			</view>
		  <!-- <nodata v-if="pinkDataList.length==0"></nodata> -->
	</view>
</template>

<script>
	var app = getApp()
	export default {
		data() {
			return {
				titleType:"",
				typeValue:"provide_resource",
				pinkDataList:[],
				content:""
			};
		},
		onLoad(e) {
			console.log(e)
			this.content = e.content
			if(e.type==0){
				this.titleType=""
			}else{
				this.titleType = e.text;
				// this.typeValue = e.value
			}
			this.getInitData()
		},
		methods:{
			getInitData(){
				app.post("ApiMingpian/serachmingpian",{
					serach_type:this.typeValue,
					keyword:this.content
				},(res)=>{
					if(res.status==1){}
					else{
						app.alert(res.msg)
					}
					console.log(res)
				})
			}
		}
	}
</script>

<style lang="less">

</style>
